using UnityEngine;
using UnityEngine.UI;
using Cinemachine;

public class ScoreManager : MonoBehaviour
{
    [Header("引用")]
    public Text scoreText;

    private int currentScore = 0;

    public CinemachineVirtualCamera c2;
    int count = 0;
    private void Start()
    {
        UpdateScoreText();
    }
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.P))
        {
            if(count%2==0)
            {
                c2.GetComponent<CinemachineVirtualCamera>().Priority = 11;
                
            }
            else
            {
                c2.GetComponent<CinemachineVirtualCamera>().Priority = 3;
            }
            count++;

        }
    }
    public void AddScore(int multiplier)
    {
        currentScore += 10 * multiplier;
        UpdateScoreText();
    }

    private void UpdateScoreText()
    {
        scoreText.text = "分数: " + currentScore;
    }
}